package org.moonlight.jvm.rtda.exclusive;

import lombok.*;
import org.apache.commons.lang3.SerializationUtils;
import org.moonlight.jvm.rtda.share.Object;

import java.io.Serializable;

/**
 * 运行时数据区 - 线程独占区 - 线程 - 虚拟机栈 - 栈帧 - 局部变量表/操作数栈 - 槽位
 *
 * @author Moonlight
 * @createTime 2023/8/16 10:45
 **/
@Getter
@Setter
@EqualsAndHashCode
public class Slot implements Serializable {

    private Number num;
    private Object ref;

    public Slot() {
        this.num = 0;
    }

    public Slot(Number num, Object ref) {
        this.num = num == null ? 0 : num;
        this.ref = ref;
    }

    public Slot(Slot slot) {
        this(slot.getNum(), slot.getRef());
    }
}
